<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta
      name="description"
      content="一个值得收藏的前端博客，里面涵盖了html,css,js,jquery等前端关键技术。"
    />
    <meta name="keywords" content="博客,个人博客,blog,html,css,js,jquery" />
    <meta name="baidu-site-verification" content="rGGzB3E5An" />
    <title>博客</title>
    <link rel="icon" href="/public/img/favicon.ico" />
    <!-- Bootstrap -->
    <link href="/public/css/bootstrap.css" rel="stylesheet" />
    <link href="/public/js/highlight/styles/androidstudio.css" rel="stylesheet" />
    <!--[if lt IE 9]>
      <script src="/public/js/html5shiv.min.js"></script>
      <script src="/public/js/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" href="/public/css/main.css" />
  </head>
  <body>
    <div class="container-fluid">
      <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container-fluid">
          <!-- Brand and toggle get grouped for better mobile display -->
          <div class="navbar-header">
            <button
              type="button"
              class="navbar-toggle collapsed"
              data-toggle="collapse"
              data-target="#bs-example-navbar-collapse-1"
              aria-expanded="false"
            >
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/"
              ><span
                ><img
                  src="/public/img/favicon.png"
                  style="margin-top: -5px;"
                />&nbsp;</span
              ></a
            >
          </div>

          <!-- Collect the nav links, forms, and other content for toggling -->
          <div
            class="collapse navbar-collapse"
            id="bs-example-navbar-collapse-1"
          >
            <form class="navbar-form navbar-left">
              <div class="form-group">
                <div class="input-group">
                  <input
                    type="text"
                    class="form-control"
                    placeholder="搜索文章"
                    id="keyWord"
                    name="keyword"
                  />
                  <span class="input-group-btn">
                    <button
                      class="btn btn-default"
                      type="button"
                      id="searchBtn"
                    >
                      <span class="glyphicon glyphicon-search"></span>
                    </button>
                  </span>
                </div>
              </div>
            </form>
            <ul class="nav navbar-nav navbar-right">
              <li>
                <a href="https://github.com/chenggang321"
                  ><span></span>github</a
                >
              </li>
              <!--<li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">works<span class="caret"></span></a>
                        <ul class="dropdown-menu">
							<li><a href="javascript:;" style="background:#ddd;">移动端</a></li>
							<li role="separator" class="divider"></li>
							<li><a href="http://totrip.xin:9000">cell</a></li>
							<li><a href="http://totrip.xin:3000">music</a></li>
                            &lt;!&ndash; <li><a href="http://totrip.xin/美丽Q用户版">美丽Q</a></li> &ndash;&gt;
                            <li role="separator" class="divider"></li>
							<li><a href="javascript:;" style="background:#ddd;">pc端</a></li>
							<li role="separator" class="divider"></li>
							<li><a href="http://totrip.xin/yd/">仿移动官网</a></li>
                            <li role="separator" class="divider"></li>
							<li><a href="javascript:;" style="background:#ddd;">游戏</a></li>
                            <li role="separator" class="divider"></li> 
							<li><a href="http://totrip.xin/tetris/tetris%20%E7%B4%A0%E6%9D%90/tetris.html">javascript俄罗斯方块游戏</a></li>
                        </ul>
                    </li>-->
              <li>
                  <a role="button" data-toggle="collapse" href="#loginAndRegisterBox" aria-expanded="false" aria-controls="loginAndRegisterBox">
                  登陆
              </a>
              </li>
            </ul>
          </div>
          <!-- /.navbar-collapse -->
        </div>
        <!-- /.container-fluid -->
      </nav>
      <!-- <div class="row" style="margin-top: 60px" id="bannerBox">
        <div class="col-xs-12">
            <img src="/public/img/banner1.png" style="width:100%"/>
        </div>
    </div -->>
      <hr />
      <div class="row">
        <div class="col-xs-12 col-sm-3 col-md-3 col-lg-2">
          <div class="collapse" id="loginAndRegisterBox" style="margin-top:20px;">
            {%if userInfo._id%}
            <div class="panel panel-default" id="userInfo">
              <div class="panel-heading">用户信息</div>
              {%if userInfo.isAdmin%}
              <div class="panel-body">
                <span>hello,管理员！</span>
                <a href="/admin">进入管理</a>
              </div>
              {%else%}
              <div class="panel-body">
                <div>
                  你好！{{userInfo.username}} 欢迎来到我的博客！
                </div>
              </div>
              {%endif%}
              <div class="panel-body">
                <a href="javascript:;" id="logout">退出</a>
              </div>
            </div>
            {%else%}
            <form class="form-horizontal" id="loginBox">
              <div class="form-group">
                <div class="col-xs-12 col-sm-12">
                  <label for="username">
                    <span class="glyphicon glyphicon-user"></span>
                    <input
                      style="display:inline-block;width: 80%;margin-left: 10px;"
                      type="email"
                      name="username"
                      class="form-control"
                      id="username"
                      placeholder="username"
                    />
                  </label>
                </div>
              </div>
              <div class="form-group">
                <div class="col-xs-12 col-sm-12">
                  <label for="password">
                    <span class="glyphicon glyphicon-lock"></span>
                    <input
                      style="display:inline-block;width: 80%;margin-left: 10px;"
                      type="password"
                      name="password"
                      class="form-control"
                      id="password"
                      placeholder="Password"
                    />
                  </label>
                </div>
              </div>
              <div class="form-group">
                <div class="col-sm-offset-1 col-sm-10">
                  <input type="button" value="登陆" class="btn btn-default" />
                  <a href="javascript:;" class="btn btn-default colMint "
                    >去注册</a
                  >
                  <br />
                  <div
                    class="alert colWarning"
                    role="alert"
                    style="text-align: center;margin-bottom:0;padding: 0;margin-top:10px;"
                  ></div>
                </div>
              </div>
            </form>
            <form
              class="form-horizontal"
              id="registerBox"
              style="display: none"
            >
              <div class="form-group">
                <div class="col-xs-12 col-sm-12">
                  <label for="username-1">
                    <span class="glyphicon glyphicon-user"></span>
                    <input
                      style="display:inline-block;width: 80%;margin-left: 10px;"
                      type="email"
                      name="username"
                      class="form-control"
                      id="username-1"
                      placeholder="username"
                    />
                  </label>
                </div>
              </div>
              <div class="form-group">
                <div class="col-xs-12 col-sm-12">
                  <label for="password-1">
                    <span class="glyphicon glyphicon-lock"></span>
                    <input
                      style="display:inline-block;width: 80%;margin-left: 10px;"
                      type="password"
                      name="password"
                      class="form-control"
                      id="password-1"
                      placeholder="Password"
                    />
                  </label>
                </div>
              </div>
              <div class="form-group">
                <div class="col-xs-12 col-sm-12">
                  <label for="repassword">
                    <span class="glyphicon glyphicon-ok"></span>
                    <input
                      style="display:inline-block;width: 80%;margin-left: 10px;"
                      type="password"
                      name="repassword"
                      class="form-control"
                      id="repassword"
                      placeholder="repassword"
                    />
                  </label>
                </div>
              </div>
              <div class="form-group">
                <div class="col-sm-offset-1 col-sm-10">
                  <input type="button" value="注册" class="btn btn-default" />
                  <a href="javascript:;" class="btn btn-default colMint "
                    >去登录</a
                  >
                  <br />
                  <div
                    class="alert colWarning"
                    role="alert"
                    style="text-align: center;margin-bottom:0;padding: 0;margin-top:10px;"
                  ></div>
                </div>
              </div>
            </form>
            {%endif%}
          </div>
          <div class="row" id="categoryBox" style="margin-top:20px;">
            <div class="col-xs-12">
              <div class="list-group">
                {%if category==''%}
                <a href="/" class="list-group-item active">
                  全部文章分类
                </a>
                {%else%}
                <a href="/" class="list-group-item">
                  全部文章分类
                </a>
                {%endif%} {%for cate in categories%} {%if category==cate.id%}
                <a href="/?category={{cate.id}}" class="list-group-item active"
                  >{{cate.name}}</a
                >
                {%else%}
                <a href="/?category={{cate.id}}" class="list-group-item"
                  >{{cate.name}}</a
                >
                {%endif%} {%endfor%}
              </div>
            </div>
          </div>
        </div>
        <div class="col-xs-12 col-sm-9 col-md-9 col-lg-9 blog-main">
          {%block content%}{%endblock%}
        </div>
      </div>
    </div>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="/public/js/jquery-1.11.3.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="/public/js/index.js"></script>
    <script src="/public/js/comment.js"></script>
    <script src="/public/js/bootstrap.js"></script>
    <!--高亮显示-->
    <script src="/public/js/highlight/highlight.pack.js"></script>
    <!-- <script src="/public/js/vconsole.min.js"></script> -->
    <script>
      hljs.initHighlightingOnLoad()
      // var vConsole = new VConsole();
    </script>
  </body>
</html>
